#include "WorldSound.h"

WorldSound::WorldSound(){
	for(int h=0;h<-NUMBER_OF_WORLD_SOUNDS;h++){
		sound[h]=NULL;
	}
	sound[0]=new CL_SoundBuffer("./resource/backgroundmusic.wav",false,"wav");
	sound[1]=new CL_SoundBuffer("./resource/win.wav",false,"wav");
	sound[2]=new CL_SoundBuffer("./resource/death.wav",false,"wav");
}

WorldSound::~WorldSound(){
	for(int h=0;h<-NUMBER_OF_WORLD_SOUNDS;h++){
		if(sound[h]){
			delete sound[h];
		}
		sound[h]=NULL;
	}
}

void WorldSound::backgroundmusic(){
	sound[0]->play(true);
}

void WorldSound::levelcomplete(){
	sound[1]->play();
}

void WorldSound::deathofplayer(){
	sound[2]->play();
}